EMT Practice Test

1. Question Content...


Question List

Question1: What is the result of the following code snippet?
public word doWork(Account acct) {
for (Integer i = 0; i <= 2007 i++) {
insert acct;
}

Question2: Universal Containers wants to ensure that all new leads created in the system have a valid email address. They have already created a validation rule to enforce this requirement, but want to add an additional layer of validation using automation.
What would be the best solution for this requirement?

Question3: A developer creates a batch Apex job to update a large number of records, and receives reports of the job timing out and not completing.
What is the first step towards troubleshooting the issue?

Question4: Universal Containers has developed custom Apex code and Lightning Components in a Sandbox environment. They need to deploy the code and associated configurations to the Production environment.
What is the recommended process for deploying the code and configurations to Production?

Question5: A developer is tasked with building a custom Lightning web component to collect Contact information.
The form will be shared among many different types of users in the org. There are security requirements that only certain fields should be edited and viewed by certain groups of users.
What should the developer use in their Lightning Web Component to support the security requirements?

Question6: A developer must troubleshoot to pinpoint the causes of performance issues when a custom page loads in their org.
Which tool should the developer use to troubleshoot query performance?

Question7: The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is properly referenced on the Visualforce page, what should the developer do to correct the problem?

Question8: The orderHelper class is a utility class that contains business logic for processing orders. Consider the following code snippet:
Public class without sharing orderHelper {// code implementation
}
A developer needs to create a constant named delivery_multiplier with a value of 4.15. The value of the constant should not change at any time in the code.
How should the developer declare the delivery multiplier constant to meet the business objectives?

Question9: Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a master-detail relationship with the standard Account object.
Based on some internal discussions, the UC administrator tried to change the master-detail relationship to a lookup relationship, but was not able to do so.
What is a possible reason that this change was not permitted?

Question10: A developer created a child Lightning web component nested inside a parent Lightning web component. The parent component needs to pass a string value to the child component.
In which two ways can this be accomplished?
Choose 2 answers

Question11: The Account object in an organization has a master-detail relationship to a child object called Branch. The following automations exist:
* Roll-up summary fields
* Custom validation rules
* Duplicate rules
developer created a trigger on the Account object.
Which two things should the developer consider while testing the trigger code?
Choose 2 answers

Question12: A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of the new Apex helper class.
Change Set deployment to production fails with the test coverage warning:
"Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required." What should the developer do to successfully deploy the new Apex trigger and helper class?

Question13: (Full question statement)
Which statement generates a list ofLeadsandContactsthat have a field containing the phrase "ACME"?

Question14: When a user edits the Postal Code on an Account, a custom Account text field named "Timezone" must be updated based on the values in a PostalCodeToTimezone__c custom object.
Which two automation tools can be used to implement this feature? Choose 2 answers

Question15: A developer wants to mark each Account in a List<Account> as either Active or Inactive, based on the value in the LastModified each Account being greater than 90 days in the past.
Which Apex technique should the developer use?

Question16: Which exception type cannot be caught?

Question17: What is the result of the following code?

Question18: A developer created this Apex trigger that calls MyClass.mystaticMethod:
The developer creates a test class with a test method that calls MyClass.myStaticMethod directly, resulting in
81% overall code coverage What happens when the developer tries to deploy the trigger and two classes to production, assuming no other code exists?

Question19: A developer created a new after insert trigger on the Lead object that creates Task records for each Lead.
After deploying to production, an existing outside integration that inserts Lead records in batches to Salesforce is occasionally reporting total batch failures being caused by the Task insert statement. This causes the integration process in the outside system to stop, requiring a manual restart.
Which change should the developer make to allow the integration to continue when some records in a batch cause failures due to the Task insert statement, so that manual restarts are not needed?

Question20: A developer needs to have records with specific field values in order to test a new Apex class.
What should the developer do to ensure the data is available to the test?

Question21: A developer must perform a complex SOQL query that joins two objects in a Lightning component.
How can the Lightning component execute the query?

Question22: A business has a proprietary Order Management System (OMS) that creates orders from its website and fulfills the orders. When the order is created in the OMS, an integration also creates an order record inSalesforce and relates it to the contact as identified by the email on the order. As the order goes through different stages in the OMS, the integration also updates it in Salesforce.
The business notices that each update from the OMS creates a new order record in Salesforce.
Which two actions should prevent the duplicate order records from being created in Salesforce?
Choose 2 answers

Question23: Which code in a Visualforce page and/or controller might present a security vulnerability?

Question24: Universal Containers has a Visualforce page that displays a table of every Container__c being rented by a given Account. Recently this page is failing with a view state limit because some of the customers rent over
10,000 containers.
What should a developer change about the Visualforce page to help with the page load errors?

Question25: Universal Containers (UC) wants to lower its shipping cost while making the shipping process more efficient.
The Distribution Officer advises UC to implement global addresses to allow multiple Accounts to share a default pickup address. The developer is tasked to create the supporting object and relationship for this business requirement and uses the Setup Menu to create a custom object called "Global Address".
Which field should the developer add to create the most efficient model that supports the business need?

Question26: Universal Containers (UC) uses out-of-the-box order management, that has a Master-Detail relationship between Order and Order Line Item.
UC stores the availability date on each Order Line Item and Orders are only shipped when all of the Order Line Items are available.
Which method should be used to calculate the estimated ship date for an Order?

Question27: Universal Containers is developing a new Lightning web component for their marketing department. They want to ensure that the component is fine-tuned and provides a seamless user experience.
What are some benefits of using the Lightning Component framework?

Question28: A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunityLineltem trigger.
Which method allows access to the price book?

Question29: A software company is using Salesforce to track the companies they sell their software to in the Account object. They also use Salesforce to track bugs in their software with a custom object, Bug__c.
As part of a process improvement initiative, they want to be able to report on which companies have reported which bugs. Each company should be able to report multiple bugs and bugs can also be reported by multiple companies.
What is needed to allow this reporting?

Question30: Universal Containers needs to create a custom user interface component that allows users to enter information about their accounts.
The component should be able to validate the user input before saving the information to the database.
What is the best technology to create this component?

Question31: Universal Containers has implemented an order management application. Each Order can have one or more Order Line items. The Order Line object is related to the Order via a master-detail relationship. For each Order Line item, the total price is calculated by multiplying the Order Line item price with the quantity ordered.
What is the best practice to get the sum of all Order Line item totals on the Order record?

Question32: A custom Visualforce controller calls the ApexPages.addMessage() method, but no messages are rendering on the page.
Which component should be added to the Visualforce page to display the message?

Question33: Which three Salesforce resources can be accessed from a Lightning web component?
Choose 3 answers

Question34: (Full question statement)
Universal Containers wants Opportunities to no longer be editable when they reach the Closed/Wonstage.
Which two strategies can a developer use to accomplish this?
Choose 2 answers.

Question35: A lead developer creates a virtual class called "OrderRequest". Consider the following code snippet:
apex
Copy
public class CustomerOrder {
// code implementation
}
How can a developer use the OrderRequest class within the CustomerOrder class?

Question36: What are three characteristics of change set deployments?
Choose 3 answers Sending a change set between two orgs requires a deployment connection.

Question37: Developers at Universal Containers (UC) use version control to share their code changes, but they notice that when they deploy their code to different environments they often have failures. They decide to set up Continuous Integration (CI).
What should the UC development team use to automatically run tests as part of their CI process?

Question38: Given the following Anonymous block:

What should a developer consider for an environment that has over 10,000 Case records?

What should a developer consider for an environment that has over 10,000 Case records?

Question39: A developer created a custom order management app that uses an Apex class. The order is represented by an Order object and an OrderlItem object that has a master-detail relationship to Order. During order processing, an order may be split into multiple orders.
What should a developer do to allow their code to move some existing OrderItem records to a new Order record?

Question40: Universal Containers has a large number of custom applications that were built using a third-party JavaScript framework and exposed using Visualforce pages. The company wants to update these applications to apply styling that resembles the look and feel of Lightning Experience.
What should the developer do to fulfill the business request in the quickest and most effective manner?

Question41: Universal Containers (UC) uses out-of-the-box order management, that has a Master-Detail relationship between Order and Order Line Item.
UC stores the availability date on each Order Line Item and Orders are only shipped when all of the Order Line Items are available.
Which method should be used to calculate the estimated ship date for an Order?

Question42: A developer has identified a method in an Apex class that performs resource intensive actions in memory by iterating over the result set of a SOQL statement on the account. The method also performs a DML statement to save the changes to the database.
Which two techniques should the developer implement as a best practice to ensure transaction control and avoid exceeding governor limits'* Choose 2 answers

Question43: Cloud Kicks has a multi-screen flow that its call center agents use when handling inbound service desk calls.
At one of the steps in the flow, the agents should be presented with a list of order numbers and dates that are retrieved from an external order management system in real time and displayed on the screen.
What should a developer use to satisfy this requirement?

Question44: What is the value of the Trigger.old context variable in a before insert trigger?

Question45: A custom picklist field, Pool Preference , exists on a custom object. The picklist contains the following options: 'Vegan', 'Kosher', 'No Preference'. The developer must ensure a value is populated every time a record is created or updated.
What is the optimal way to ensure a value is selected every time a record is saved?

Question46: What are three considerations when using the @lnvocableMethod annotation in Apex?
Choose 3 answers

Question47: In the following example, which sharing context will myMethod execute when it is invoked?

Question48: A developer has an integer variable called maxAttempts. The developer needs to ensure that once maxAttempts is initialized, it preserves its value for the length of the Apex transaction; while being able to share the variable's state between trigger executions.
How should the developer declare maxAttempts to meet these requirements?

Question49: A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which three statements are useful inside the unit test to effectively test the custom controller?
Choose 3 answers

Question50: How many Accounts will be inserted by the following block of code?

Question51: While working in a sandbox, an Apex test fails when run in the Test Runner. However, executing the Apex logic in the Execute Anonymous window succeeds with no exceptions or errors.
Why did the method fail in the sandbox test framework but succeed in the Developer Console?

Question52: Which three data types can a SOQL query return?
Choose 3 answers

Question53: Since Aura application events follow the traditional publish-subscribe model, which method is used to fire an event?

Question54: Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One of the application modules allows the user to calculate body fat using the Apex class, Bodyfat, and its method, calculateBodyFat (). The product owner wants to ensure this method is accessible by the consumer of the application when developing customizations outside the ISV's package namespace.
Which approach should a developer take to ensure calculateBodyFat () is accessible outside the package namespace?

Question55: A developer writes a trigger on the Account object on the before update event that increments a count field. A record triggered flow also increments the count field every time that an Account is created or updated.
What is the value of the count field if an Account is inserted with an initial value of zero, assuming no other automation logic is implemented on the Account?

Question56: A developer has a Visualforce page and custom controller to save Account records. The developer wants to display any validation rule violations to the user.
How can the developer make sure that validation rule violations are displayed?

Question57: What are two ways a developer can get the status of an enqueued job for a class that implements the queueable interface?
Choose 2 answers

Question58: A developer is asked to write helper methods that create test data for unit tests.

What should be changed in the TestUtils class so that its methods are only usable by unit test methods?

Question59: For which three items can a trace flag be configured?
Choose 3 answers

Question60: Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?

Question61: A lead developer creates a virtual class called "OrderRequest". Consider the following code snippet:
Public class CustomerOrder {
//code implementation
}
How can a developer use the OrderRequest class within the CustomerOrder class?

Question62: (Full question statement)
A developer must create a CreditCardPayment class that provides an implementation of an existing Payment class.
public virtual class Payment {
public virtual void makePayment(Decimal amount) {
// implementation
}
}
Which is the correct implementation?

Question63: A developer wants to improve runtime performance of Apex calls by caching results on the client.
What is the most efficient way to implement this and follow best practices?

Question64: A lead developer creates an Apex interface called Laptop.
Consider the following code snippet:
apex
CopyEdit
public class SilverLaptop {
// code implementation
}
How can a developer use the Laptop interface within the SilverLaptop class?

Question65: A developer is designing a new application on the Salesforce platform and wants to ensure it can support multiple tenants effectively.
Which design framework should the developer consider to ensure scalability and maintainability?

Question66: What are two characteristics related to formulas?
Choose 2 answers

Question67: A developer wants to import 500 Opportunity records into a sandbox.
Why should the developer choose to use Data Loader instead of Data Import Wizard?

Question68: Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records.
Which Visualforce feature supports this requirement?

Question69: What are two considerations for deploying from a sandbox to production?
Choose 2 answers

Question70: Refer to the component code requirements below:
<lightning:layout multipleRows="true">
<lightning:layoutItem size="12">{!v.account.Name}</lightning:layoutItem>
<lightning:layoutItem size="12">{!v.account.AccountNumber}</lightning:layoutItem>
<lightning:layoutItem size="12">{!v.account.Industry}</lightning:layoutItem>
</lightning:layout>
Requirements:
* For mobile devices, the information should display in three rows.
* For desktops and tablets, the information should display in a single row.
Requirement 2 is not displaying as desired.
Which option has the correct component code to meet the requirements for desktops and tablets?

Question71: (Full question statement)
A developer is tasked with building a custom Lightning Web Component (LWC) to collectContactinformation. The form will be shared among different types of users in the org. There are security requirements stating that only certain fields should beeditable and visibleto certain groups of users.
What should the developer use in their Lightning Web Component to support the security requirements?

Question72: A developer has the following requirements:
* Calculate the total amount on an Order.
* Calculate the line amount for each Line Item based on quantity selected and price.
* Move Line Items to a different Order if a Line Item is not in stock.
Which relationship implementation supports these requirements on its own?

Question73: A developer needs to allow users to complete a form on an Account record that will create a record for a custom object.
The form needs to display different fields depending on the user's job role, The functionality should only be available to a small group of users.
Which three things should the developer do to satisfy these requirements?
Choose 3 answers

Question74: What are two use cases for executing Anonymous Apex code?
Choose 2 answers

Question75: A developer wants to send an outbound message when a record meets a specific criteria.
Which two features satisfy this use case?

Question76: An Apex method, getAccounts, that returns a List of Accounts given a searchTerm, is available for Lightning Web Components to use.
What is the correct definition of a Lightning Web Component property that uses the getAccounts method?

Question77: A software company uses the following objects and relationships:
* Case: to handle customer support issues
* Defect__c: a custom object to represent known issues with the company's software
* Case Defect__c a junction object between Case and Defect __c to represent that a defect is a cause of a customer issue Case and Defect__c have Private organization-wide defaults.
What should be done to share a specific Case_Defect__c record with a user?

Question78: An org has an existing flow that edits an Opportunity with an Update Records element. A developer must update the flow to also create a Contact and store the created Contact's ID on the Opportunity.
Which update must the developer make in the flow?

Question79: A Primaryld_c custom field exists on the Candidate _c custom object. The field is used to store each candidate's id number and is marked as Unique in the schema definition.
As part of a data enrichment process, Universal Containers has a CSV file that contains updated data for all candidates in the system. The file contains each Candidate's primary .. as a data point. Universal Containers wants to upload this information into Salesforce, while ensuring all data rows are correctly mapped to a candidate in the system.
Which technique should the developer implement to streamline the data upload?

Question80: How does the Lightning Component framework help developers implement solutions faster?

Question81: A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system.
Within the class, the developer identifies the following method as a security threat:
ist<Contact> performSearch (String lastName} [
return Database.query('SELECT Id, FirstName, LastName FROM Contact WHERE LastName Like s'+lastName+'s'")?; What are two ways the developer can update the method to prevent a SOQL injection attack?
Choose 2 answers

Question82: Which three statements are accurate about debug logs?
Choose 3 answers

Question83: Which two are best practices when it comes to Aura component and application event handling?
Choose 2 answers

Question84: Universal Containers has a support process that allows users to request support from its engineering team using a custom object, Engineering Support c.
Users should be able to associate multiple Engineering Support __c records to a single Opportunity record.
Additionally, aggregate information
about the Engineering Support _c records should be shown on the Opportunity record.
Which relationship field should be implemented to support these requirements?